package com.dly.hope.repository;

import com.dly.hope.workflow.NodeRole;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/** 
* @Name: NodeRoleRepository
 * @Description:
 * @Author: Danny Chen
 * @Date: 2022/1/18
 */
public interface NodeRoleRepository extends JpaRepository<NodeRole, String> {

    List<String> getRoleIdByNodeIdAndDataStatus(String nodeId, Integer code);

    List<NodeRole> findAllByNodeIdAndRoleIdAndDataStatus(String nodeId, String roleId, Integer dataStatus);

    List<NodeRole> findByNodeIdAndDataStatus(String nodeId, Integer dataStatus);

    List<NodeRole> findByNodeIdInAndDataStatus(List<String> nodeIds, Integer dataStatus);

    List<NodeRole> findByRoleIdAndDataStatus(String roleId, Integer dataStatus);
}
